#include "Expression.h"

Expression::~Expression()
{
	delete E;
	E = 0;
}

Expression::Expression(int size = 1):E()
{
	this->ContainerSize = size;
	this->E = new ExpressionContainer[size];
}

int Expression::GetResult()
{
	return this->Result;
}

void Expression::Solve()
{
	for(int i=0;  i < ContainerSize ; i++)
	{
		this->E[i].Solve();
	}
	this->Result =* this->E[ContainerSize-1].GetC();
}

ExpressionContainer& Expression::operator[](int i)
{
	return E[i];
}